package zj.playCard;

public class PlayerEntity extends PokerEntity {

    String userId;
    String userName;
    char[] cards;

    public String getUserId() {
	return this.userId;
    }

    public PlayerEntity setUserId(String userId) {
	this.userId = userId;
	return this;
    }

    public String getUserName() {
	return this.userName;
    }

    public PlayerEntity setUserName(String userName) {
	this.userName = userName;
	return this;
    }

    public char[] getCards() {
	return this.cards;
    }

    public void setCards(char[] cards) {
	this.cards = cards;
    }

    public String getCardsName(char str) {
	String s = "";
	for (char c : this.cards) {
	    s += c + ",";
	}
	return s;
    }

    public String getCardsName(String str) {
	String s = "";
	for (char c : this.cards) {
	    s += super.getCardName(c) + ",";
	}
	return s;
    }

    public void cardsSerilizeabled() {
	for (int i = 0; i < this.cards.length - 1; i++) {
	    char temp = this.cards[i];
	    for (int j = this.cards.length - 1; j > i; j--) {
		if (this.cards[i] > this.cards[j]) {
		    temp = this.cards[j];
		    this.cards[j] = this.cards[i];
		    this.cards[i] = temp;
		}
	    }
	}
    }

}
